<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <include file="public:meta"/>
    <link href="../public/css/personal/common.css" rel="stylesheet" type="text/css"/>
    <link href="../public/css/personal/personal_user.css" rel="stylesheet" type="text/css"/>
    <link href="../public/css/personal/personal_ajax_dialog.css" rel="stylesheet" type="text/css"/>
    <script src="../public/js/personal/jquery.common.js" type="text/javascript" language="javascript"></script>
</head>
<body>
<include file="public:header_other" />
<div class="us-top">
    <div class="us-main">
        <div class="us-top-box">
            <form id="ajax_search_location" action="{:U('ajaxCommon/ajax_search_location',array('type'=>'QS_jobslist'))}" method="get">
                <div class="input-box"><input type="text" name="key" data-original="请输入关键字" value="" placeholder="请输入关键字" autocomplete="off"></div>
                <div class="se-btn"><input type="submit" value="搜 索"></div>
                <div class="clear"></div>
            </form>
        </div>
    </div>
</div>
<div class="user_main">
    <include file="Personal:index_left_nav"/>
    <div class="mainbox">
        <!--切换卡 -->
        <div class="tab">
            <a class="li J_hoverbut" href="{:U('index')}">我的{:C('qscms_points_byname')}</a>
            <a class="li select ">我的任务</a>
            <a class="li J_hoverbut " href="{:U('increment')}">增值服务</a>
            <a class="li J_hoverbut " href="{:U('order_list')}">服务订单</a>
            <notempty name="apply['Mall']">
                <a class="li J_hoverbut " href="{:U('order_list_goods')}">商城订单</a>
            </notempty>
            <div class="clear"></div>
        </div>
        <!--切换卡结束 -->

        <div class="task_top_gold">
            <div class="gold">
                <div class="photobox">
                    <img border="0" src="../public/images/29.png"/>
                </div>
                <div class="rightbox">
                    <div class="txt">剩余{:C('qscms_points_byname')}：<strong>{$mypoints}</strong></div>
                    <div class="btns">
                        <a href="{:U('increment')}" class="J_hoverbut btn_blue btn_inline">兑换服务</a>
                        <notempty name="apply['Mall']">
                            <a href="{:url_rewrite('QS_mall_index')}" class="btn_yellow J_hoverbut btn_inline">兑换商品</a>
                        </notempty>
                    </div>
                </div>
                <div class="clear"></div>

            </div>
            <div class="todaygold">
                <div class="txt">今天已获得 <strong>{$points_count['obtain']}</strong> {:C('qscms_points_byname')}</div>
                <div class="txt link_blue">您还可免费获得 <strong>{$points_count['able']}</strong> {:C('qscms_points_byname')}
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{:U('index')}">[{:C('qscms_points_byname')}收支明细]</a></div>
            </div>
            <div class="clear"></div>
        </div>
        <!--小标题切换卡 -->
        <div class="thtab">
            <div class="li J_hoverbut select">未完成任务</div>
            <div class="li J_hoverbut">已完成任务</div>
            <div class="clear"></div>
        </div>
        <div class="task_th">
            <div class="th1">任务标题</div>
            <div class="th2">{:C('qscms_points_byname')}</div>
            <div class="th3">类型</div>
            <div class="th4">状态</div>
            <div class="clear"></div>
        </div>
        <div class="tabshow" style="display:block">
            <volist name="task" id="vo">
                <if condition="!isset($done_task[$vo['id']]) || ($done_task[$vo['id']] gt 0 and $done_task[$vo['id']] lt $vo['times'])">
                    <div class="task J_hoverbut">
                        <div class="td1 {$vo['t_alias']}">{$vo['title']}
                            <if condition="$done_task[$vo['id']] gt 0 && $vo['once'] eq '0' && $vo['times'] gt $done_task[$vo['id']]">
                                ( {$done_task[$vo['id']]} / {$vo['times']} )
                            </if>
                        </div>
                        <div class="td2">
                            +{$vo['points']}
                            <if condition="$done_task[$vo['id']] gt 0 && $vo['once'] eq '0' && $vo['times'] gt $done_task[$vo['id']]">
                                <span>( x{$vo['times']} )</span>
                            </if>
                        </div>
                        <div class="td3">
                            <if condition="$vo['once'] eq '1'">一次性任务<else/>日常任务</if>
                        </div>
                        <div class="td4 link_blue"><a data-type="{$vo['t_alias']}" <if condition="$task_url[$vo['t_alias']]['type'] eq 'blank'">target="_blank"<elseif condition="$task_url[$vo['t_alias']]['type'] eq 'ajax'" />data="{$vo['t_alias']}" class="ajax_do"<else /></if> href="{$task_url[$vo['t_alias']]['url']}">去完成</a></div>
                        <div class="clear"></div>
                    </div>
                </if>
            </volist>
        </div>
        <div class="tabshow">
            <volist name="task" id="vo">
                <if condition="isset($done_task[$vo['id']]) && ($done_task[$vo['id']] eq $vo['times'] || $vo['id'] eq 3)">
                    <div class="task J_hoverbut">
                        <div class="td1 {$vo['t_alias']}">{$vo['title']}</div>
                        <div class="td2">+{$vo['points']}</div>
                        <div class="td3">
                            <if condition="$vo['once'] eq '1'">一次性任务
                                <else/>
                                日常任务
                            </if>
                        </div>
                        <div class="td4 ok">已完成</div>
                        <div class="clear"></div>
                    </div>
                </if>
            </volist>
        </div>
    </div>
    <div class="clear"></div>
</div>
<include file="Personal:index_footer"/>
<script src="../public/js/company/jquery.zclip.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(".ajax_do").click(function(){
        var type = $(this).attr('data-type');
        var url = $(this).attr('href');
        if(type=='sign'){
            $.getJSON(url,function(result){
                if(result.status == 1){
                    disapperTooltip("goldremind", '每天签到增加'+result.data+'{:C('qscms_points_byname')}<span class="point">+'+result.data+'</span>');
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000);
                }else{
                    disapperTooltip('remind',result.msg);
                }
            });
        }
        else if(type=='invitation_reg')
        {
            var qsDialog = $(this).dialog({
                loading: true,
                footer: false,
                header: false,
                border: false,
                backdrop: false
            });
            $.getJSON(url,function(result){
                if(result.status == 1){
                    qsDialog.hide();
                    var qsDialogSon = $(this).dialog({
                        title: '推荐注册',
                        content: result.data,
                        footer:false
                    });
                    $('.qshowa').zclip({
                        path: '../public/flash/ZeroClipboard.swf',
                        copy: function(){
                            return $('.qshowa').attr('url');
                        },
                        afterCopy: function(){
                            $('#J_forcopytxt').text('复制成功').css('color', '#FF6600');
                        }
                    });
                }else{
                    qsDialog.hide();
                    disapperTooltip('remind',result.msg);
                }
            });
        }
        return false;
    });
</script>
</body>
</html>